<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center"><div class="table-first-id">ID</div></th>
            <th class="text-center" width="10%">礼品卡名称</th>
            <th class="text-center" width="10%">礼卡类型</th>
            <th class="text-center" width="10%">生成数量</th>
            <th class="text-center" width="20%">有效时间</th>
            <th class="text-center" width="20%">创建时间</th>
            <th class="text-center" width="10%">状态</th>
            <th class="text-center" width="15%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody id="tbodyGiftCard">
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="20%">&nbsp;</th>
                    <th class="text-center" width="20%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="15%">&nbsp;</th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="8" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="giftCard : ${dataMap['list']}">
                    <td class="text-center">
                        <input type="checkbox" class="i-checks" name="giftCardId" th:value="${giftCard['id']}" >
                    </td>
                    <td class="text-center" th:text="${giftCard['cardName']}"></td>
                    <td class="text-center ">
                        <span th:if="${giftCard['cardType']}==1">学员卡</span>
                        <span th:if="${giftCard['cardType']}==2">课程卡</span>
                        <span th:if="${giftCard['cardType']}==3">充值卡</span>
                    </td>
                    <td class="text-center" th:text="${giftCard['genNum']}">
                    </td>
                    <td class="text-center">
                        <span th:if="${giftCard['timeType']}==1" class="pie" th:text="${#strings.substring(giftCard['beginTime'],0,16)}+'—'+${#strings.substring(giftCard['endTime'],0,16)}">
                        </span>
                        <span th:if="${giftCard['timeType']}==2" th:text="${giftCard['timeDays']}+'天'"></span>
                    </td>
                    <td class="text-center">
                        <span class="pie" th:text="${#strings.substring(giftCard['createTime'],0,16)}"> </span>
                    </td>
                    <td class="text-center status">
                        <span th:if="${giftCard['status']}==1" class="label label-info">正常</span>
                        <span th:if="${giftCard['status']}==2" class="label label-danger">冻结</span>
                        <span th:if="${giftCard['status']}==0" class="label label-danger">待发布</span>
                    </td>
                    <td class="text-center">
                        <a th:href="@{/admin/op/giftCard/queryOpGiftCardById?giftCardId={giftCardId}(giftCardId=${giftCard['id']})}" class="c-master fs14  updateStatus" data-toggle="tooltip" data-placement="bottom" data-original-title="查看"><i class="fa fa-eye"></i></a>
                        <a th:if="${giftCard['status']}==1" href="javascript:void(0);" class="c-master fs14 ml5 unlockAndHistory"  th:attr="data-id=${giftCard['id']},data-status=${giftCard['status']}"  data-toggle="tooltip" data-placement="bottom" data-original-title="冻结"><i class="fa fa-unlock-alt"></i></a>
                        <a th:if="${giftCard['status']}==2" href="javascript:void(0);" class="c-master fs14 ml5 unlockAndHistory"  th:attr="data-id=${giftCard['id']},data-status=${giftCard['status']}"  data-toggle="tooltip" data-placement="bottom" data-original-title="恢复"><i class="fa fa-history"></i></a>
                        <a th:if="${giftCard['status']}==0" href="javascript:void(0);" class="c-master fs14 ml5 releaseAndUnRelease"  th:attr="data-id=${giftCard['id']},data-status=${giftCard['status']}"  data-toggle="tooltip" data-placement="bottom" data-original-title="待发布"><i class="fa fa-arrow-up"></i></a>
                        <a th:if="${giftCard['cardType']}!=1 and ${giftCard['status']}==1 and !${giftCard['isExchange']}" href="javascript:void (0);" class="c-master fs14 ml5 " id="selectUser"  th:attr="data-id=${giftCard['id']},data-status=${giftCard['status']}" data-toggle="tooltip" data-placement="bottom" data-original-title="赠送"><i class="fa fa-gift"></i></a>
                        <a href="javascript:void (0);" class="c-master fs14 ml5 deleteGiftCard"    th:attr="data-id=${giftCard['id']},data-status=${giftCard['status']}"   data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-trash-o"></i></a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div data-th-replace="layout/adminPage"></div>
</div>
